﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="WebFormTipologias.aspx.cs" Inherits="welwitschia.Tipologias.WebFormTipologias" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="header" class="info">
        <h2>
            <asp:Label ID="Label1" runat="server" Text="Tipologias - "></asp:Label>
        </h2>
    </div>
    <div>
        <asp:ListView runat="server" ID="ListView1" DataKeyNames="Tipo, Codigo" OnItemDeleting="ListView1_ItemDeleting"
            OnItemEditing="ListView1_ItemEditing" 
            OnItemCommand="ListView1_ItemCommand" 
            onpagepropertieschanging="ListView1_PagePropertiesChanging">
            <LayoutTemplate>
                <table runat="server" class="grd2" id="table1">
                    <thead>
                        <tr class="ghdr2">
                            <td>
                                Codigo
                            </td>
                            <td>
                                Descricao
                            </td>
                            <td>
                                Descrição Curta
                            </td>
                            <td>
                                Simbolo
                            </td>
                            <td>
                                Tipo
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </thead>
                    <tr runat="server" id="itemPlaceholder">
                    </tr>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr id="Tr1" class='grd2<%#Container.DataItemIndex % 2 %>'>
                    <td id="Td1" runat="server">
                        <%-- Data-bound content. --%>
                        <asp:Label ID="Label1" runat="server" Text='<%#Eval("Codigo") %>' />
                    </td>
                    <td id="Td2" runat="server">
                        <%-- Data-bound content. --%>
                        <asp:Label ID="NameLabel" runat="server" Text='<%#Eval("Descricao") %>' />
                    </td>
                    <td id="Td4" runat="server">
                        <%-- Data-bound content. --%>
                        <asp:Label ID="Label2" runat="server" Text='<%#Eval("DescricaoCurta") %>' />
                    </td>
                    <td id="Td5" runat="server">
                        <%-- Data-bound content. --%>
                        <asp:Label ID="Label3" runat="server" Text='<%#Eval("Simbolo") %>' />
                    </td>
                    <td id="Td6" runat="server">
                        <%-- Data-bound content. --%>
                        <asp:Label ID="Label4" runat="server" Text='<%#Eval("Tipo") %>' />
                    </td>
                    <td id="Td3" runat="server">
                        <%-- Data-bound content. --%>
                        <asp:LinkButton ID="EditButton" CommandName="Edit" CommandArgument='<%# String.Concat(Eval("Tipo"),";", Eval("Codigo"))%>'
                            runat="server" Text="Editar"></asp:LinkButton>
                        <asp:LinkButton ID="DeleteButton" OnClientClick="return confirm('Quer Apagar registo?');"
                            CommandName="Delete" CommandArgument='<%# String.Concat(Eval("Tipo"),";", Eval("Codigo"))%>'
                            runat="server" Text="Apagar"></asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:ListView>
        <div class="pagination-clean">
            <asp:DataPager ID="dplvTipologias" runat="server" PagedControlID="ListView1" PageSize="20">
                <Fields>
                    <asp:NextPreviousPagerField ButtonCssClass="command" FirstPageText="« Anterior" PreviousPageText="« Anterior"
                        RenderDisabledButtonsAsLabels="false" ShowFirstPageButton="false" ShowPreviousPageButton="true"
                        ShowLastPageButton="false" ShowNextPageButton="false" RenderNonBreakingSpacesBetweenControls="False" />
                    <asp:NumericPagerField CurrentPageLabelCssClass="current" NextPreviousButtonCssClass="next"
                        RenderNonBreakingSpacesBetweenControls="False" />
                    <asp:NextPreviousPagerField ButtonCssClass="command" LastPageText="›" NextPageText="Seguinte »"
                        RenderDisabledButtonsAsLabels="false" ShowFirstPageButton="false" ShowPreviousPageButton="false"
                        ShowLastPageButton="false" ShowNextPageButton="true" RenderNonBreakingSpacesBetweenControls="False" />
                </Fields>
            </asp:DataPager>
        </div>
    </div>
    <div class="pageCommandArea">
        <asp:Button ID="Button1" runat="server" Text="Criar" OnClick="Unnamed1_Click" /></div>
    <asp:HiddenField ID="hfTipo" runat="server" />
</asp:Content>
